//
//  TypeCell.m
//  Final
//
//  Created by student on 2021/12/16.
//  Copyright © 2021 Lenrony. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TypeCell.h"

@interface TypeCell ()

@property(strong, nonatomic) UILabel* label;

@end

@implementation TypeCell

-(void)selectOn
{
    self.label.layer.borderColor = [UIColor colorWithRed:0 green:0.7f blue:0 alpha:1].CGColor;
    self.label.textColor = [UIColor colorWithRed:0 green:0.7f blue:0 alpha:1];
}

-(void)selectOff
{
    self.label.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.label.textColor = [UIColor lightGrayColor];
}

-(void)setChoice:(NSString*)str
{
    if(self.label == nil){
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 80, 20)];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.layer.borderWidth = 1;
        self.label.layer.cornerRadius = 5;
        [self addSubview:self.label];
    }
    self.label.text = str;
}

@end
